package com.zp.demo;

import com.zp.demo.entity.Result;
import com.zp.demo.repush.vo.RePushProperties;
import com.zp.demo.service.SendDataService;
import com.zp.demo.service.TestSetRedis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class RepushApplication {
    @Autowired
    RePushProperties rePushProperties;
    @Autowired
    SendDataService sendDataService;
    @Autowired
    TestSetRedis setRedis;
    public static void main(String[] args) {
        SpringApplication.run(RepushApplication.class, args);
    }
    @RequestMapping("test")
    public Result<Boolean> test(String test){
        sendDataService.sendSSS(test);
        return Result.success(true);
    }

    @RequestMapping("redis")
    public Result<Boolean> redis(String key){
        boolean flag = setRedis.setRedis(key);
        return Result.success(flag);
    }
    @RequestMapping("redis2")
    public Result<Boolean> redis2(String key){
        boolean flag = setRedis.setRedis2(key);
        return Result.success(flag);
    }
}

